package com.huiqiao.sys.controller;

import com.huiqiao.sys.domain.LogInfoVo;
import com.huiqiao.sys.service.LogInfoService;
import com.huiqiao.sys.utils.DataGridView;
import com.huiqiao.sys.utils.ResultObj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: yanliwei@foolish
 * @CreateTime: 2024-12-23  16:28
 */

@RestController
@RequestMapping("/logInfo")
public class LogInfoController{

    @Autowired
    private LogInfoService logInfoService;


    @RequestMapping("loadAllLogInfo")
    public DataGridView loadAllLogInfo(LogInfoVo logInfoVo) {
        return logInfoService.queryAllLogInfo(logInfoVo);
    }

    //删除
    @RequestMapping("deleteLogInfo")
    public ResultObj deleteLogInfo(LogInfoVo logInfoVo) {
        try {
            this.logInfoService.deleteLogInfo(logInfoVo);
            return ResultObj.DELETE_SUCCESS;
        }catch (Exception e){
            return ResultObj.DELETE_ERROR;
        }
    }

    //批量删除
    @RequestMapping("deleteBatchLogInfo")
    public ResultObj deleteBatchLogInfo(LogInfoVo logInfoVo) {
        try {
            this.logInfoService.deleteBatchLogInfo(logInfoVo.getIds());
            return ResultObj.DELETE_SUCCESS;
        }catch (Exception e){
            return ResultObj.DELETE_ERROR;
        }
    }


}
